using UnityEngine;
using System.Collections;

public class Parallax : MonoBehaviour 
{
	private float parallaxOffset;
	public float speed;
	
	void Start () 
	{
		
	}
	
	void Update () 
	{
		
	}
	
	public void SetParallax(string mode)
	{
		switch(mode)
		{
			case "Normal":
				parallaxOffset -= speed;
				
				break;
				
			case "Reverse":
				parallaxOffset += speed;
			
				break;
				
			default:
			
				break;
		}

        renderer.material.mainTextureOffset = new Vector2(parallaxOffset * speed, 0);
	}	
}
